package com.esri.core.internal.value;

import com.esri.core.geometry.Envelope;
import com.esri.core.geometry.MapGeometry;
import com.esri.core.map.Field;
import com.esri.core.map.ImageServiceParameters;
import com.esri.core.map.TimeInfo;
import java.io.Serializable;
import java.util.ArrayList;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class a implements Serializable {
    private static final String D = "None";
    private static final String E = "Center";
    private static final String F = "NorthWest";
    private static final String G = "LockRaster";
    private static final String H = "ByAttribute";
    private static final String I = "Nadir";
    private static final String J = "Viewpoint";
    private static final String K = "Seamline";
    private static final String L = "Blend";
    private static final String M = "Sum";
    private static final String N = "First";
    private static final String O = "Last";
    private static final String P = "Max";
    private static final String Q = "Mean";
    private static final String R = "Min";
    private static final long serialVersionUID = 1;
    String A;
    String B;
    double a;
    String b;
    String c;
    String d;
    MapGeometry e;
    Envelope f;
    Envelope g;
    int j;
    ImageServiceParameters.PIXEL_TYPE k;
    String n;
    String o;
    double[] p;
    double[] q;
    double[] r;
    double[] s;
    String t;
    Field[] u;
    String v;
    TimeInfo y;
    double h = Double.NaN;
    double i = Double.NaN;
    double l = Double.NaN;
    double m = Double.NaN;
    double w = Double.NaN;
    double x = Double.NaN;
    int z = -1;
    int C = -1;

    public static long a() {
        return 1L;
    }

    public a(String str) {
        this.v = str;
    }

    public double b() {
        return this.a;
    }

    public String c() {
        return this.b;
    }

    public String d() {
        return this.c;
    }

    public String e() {
        return this.d;
    }

    public MapGeometry f() {
        return this.e;
    }

    public Envelope g() {
        return this.f;
    }

    public void a(Envelope envelope) {
        this.f = envelope;
    }

    public Envelope h() {
        return this.g;
    }

    public void b(Envelope envelope) {
        this.g = envelope;
    }

    public double i() {
        return this.h;
    }

    public double j() {
        return this.i;
    }

    public int k() {
        return this.j;
    }

    public ImageServiceParameters.PIXEL_TYPE l() {
        return this.k;
    }

    public double m() {
        return this.l;
    }

    public double n() {
        return this.m;
    }

    public String o() {
        return this.n;
    }

    public String p() {
        return this.o;
    }

    public double[] q() {
        return this.p;
    }

    public double[] r() {
        return this.q;
    }

    public double[] s() {
        return this.r;
    }

    public double[] t() {
        return this.s;
    }

    public String u() {
        return this.t;
    }

    public Field[] v() {
        return this.u;
    }

    public String w() {
        return this.v;
    }

    public double x() {
        return this.w;
    }

    public double y() {
        return this.x;
    }

    public TimeInfo z() {
        return this.y;
    }

    public int A() {
        return this.z;
    }

    public String B() {
        return this.A;
    }

    public String C() {
        return this.B;
    }

    public int D() {
        return this.C;
    }

    public static a a(JsonParser jsonParser, String str) throws Exception {
        if (com.esri.core.internal.util.d.c(jsonParser)) {
            a aVar = new a(str);
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if ("currentVersion".equals(currentName)) {
                    aVar.a = jsonParser.getDoubleValue();
                } else if ("serviceDescription".equals(currentName)) {
                    aVar.b = jsonParser.getText();
                } else if ("name".equals(currentName)) {
                    aVar.c = jsonParser.getText();
                } else if ("description".equals(currentName)) {
                    aVar.d = jsonParser.getText();
                } else if ("copyrightText".equals(currentName)) {
                    aVar.n = jsonParser.getText();
                } else if ("extent".equals(currentName)) {
                    aVar.e = com.esri.core.internal.util.d.e(jsonParser);
                } else if ("initialExtent".equals(currentName)) {
                    MapGeometry e = com.esri.core.internal.util.d.e(jsonParser);
                    if (e != null) {
                        aVar.a((Envelope) e.getGeometry());
                    }
                } else if ("fullExtent".equals(currentName)) {
                    MapGeometry e2 = com.esri.core.internal.util.d.e(jsonParser);
                    if (e2 != null) {
                        aVar.b((Envelope) e2.getGeometry());
                    }
                } else if ("pixelSizeX".equals(currentName)) {
                    aVar.h = jsonParser.getDoubleValue();
                } else if ("pixelSizeY".equals(currentName)) {
                    aVar.i = jsonParser.getDoubleValue();
                } else if ("bandCount".equals(currentName)) {
                    aVar.j = jsonParser.getIntValue();
                } else if ("pixelType".equals(currentName)) {
                    aVar.k = ImageServiceParameters.PIXEL_TYPE.valueOf(jsonParser.getText());
                } else if ("minPixelSize".equals(currentName)) {
                    aVar.l = jsonParser.getDoubleValue();
                } else if ("maxPixelSize".equals(currentName)) {
                    aVar.m = jsonParser.getDoubleValue();
                } else if ("serviceDataType".equals(currentName)) {
                    aVar.o = jsonParser.getText();
                } else if ("objectIdField".equals(currentName)) {
                    aVar.t = jsonParser.getText();
                } else if ("fields".equals(currentName)) {
                    ArrayList arrayList = new ArrayList();
                    if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                            Field fromJson = Field.fromJson(jsonParser);
                            if (80 == fromJson.getFieldType()) {
                                aVar.t = fromJson.getName();
                            }
                            arrayList.add(fromJson);
                        }
                    }
                    aVar.u = (Field[]) arrayList.toArray(new Field[arrayList.size()]);
                } else if ("minValues".equals(currentName)) {
                    aVar.p = com.esri.core.internal.util.d.k(jsonParser);
                } else if ("maxValues".equals(currentName)) {
                    aVar.q = com.esri.core.internal.util.d.k(jsonParser);
                } else if ("meanValues".equals(currentName)) {
                    aVar.r = com.esri.core.internal.util.d.k(jsonParser);
                } else if ("stdvValues".equals(currentName)) {
                    aVar.s = com.esri.core.internal.util.d.k(jsonParser);
                } else if ("timeInfo".equals(currentName)) {
                    aVar.y = TimeInfo.fromJson(jsonParser);
                } else if ("minScale".equals(currentName)) {
                    aVar.w = jsonParser.getDoubleValue();
                } else if ("maxScale".equals(currentName)) {
                    aVar.x = jsonParser.getDoubleValue();
                } else if ("defaultMosaicMethod".equals(currentName)) {
                    aVar.z = b(jsonParser.getText());
                } else if ("sortField".equals(currentName)) {
                    aVar.A = jsonParser.getText();
                } else if ("sortValue".equals(currentName)) {
                    aVar.B = jsonParser.getText();
                } else if ("mosaicOperator".equals(currentName)) {
                    aVar.C = a(jsonParser.getText());
                } else {
                    jsonParser.skipChildren();
                }
            }
            return aVar;
        }
        return null;
    }

    private static int a(String str) {
        if (L.equals(str)) {
            return 1;
        }
        if (M.equals(str)) {
            return 7;
        }
        if (N.equals(str)) {
            return 2;
        }
        if (O.equals(str)) {
            return 3;
        }
        if (P.equals(str)) {
            return 4;
        }
        if (Q.equals(str)) {
            return 5;
        }
        return R.equals(str) ? 6 : -1;
    }

    private static int b(String str) {
        if (E.equalsIgnoreCase(str)) {
            return 2;
        }
        if (F.equalsIgnoreCase(str)) {
            return 5;
        }
        if (D.equalsIgnoreCase(str)) {
            return 0;
        }
        if (G.equalsIgnoreCase(str)) {
            return 3;
        }
        if (H.equalsIgnoreCase(str)) {
            return 1;
        }
        if (I.equalsIgnoreCase(str)) {
            return 4;
        }
        if (J.equalsIgnoreCase(str)) {
            return 7;
        }
        return K.equalsIgnoreCase(str) ? 6 : -1;
    }
}
